<template>
    <div>
        <home-header :city="dataList.city"></home-header>
        <home-swiper></home-swiper>
        <home-icons></home-icons>
        <home-recommends :itemList="dataList.itemList"></home-recommends>
    </div>
</template>

<script>
import homeHeader from './components/HomeHeader'
import homeSwiper from './components/HomeSwiper'
import homeIcons from './components/HomeIcons'
import homeRecommends from './components/HomeRecommends'
import axios from 'axios'
export default {
    name:'Home',
    components:{
        homeHeader,
        homeSwiper,
        homeIcons,
        homeRecommends
    },
    data (){
        return {
            dataList: {}
        }
    },
    methods:{
        getInfo() {
            axios.get('/api/index.json').then(this.getInfoSucc)
        },
        getInfoSucc(res) {
            this.dataList=res.data;
            
        }
    },
    mounted () {
        this.getInfo();
    }
}
</script>

<style>
    
</style>


